﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class human_fileToController : Controller
    {
        private readonly Ihuman_file he;

        public human_fileToController(Ihuman_file he)
        {
            this.he = he;
        }

        public IActionResult human_fileTo()
        {
            return View();
        }
        public IActionResult human_fileToUpdate(int? id)
        {
            ViewBag.huf_id = id;
            return View();
        }
        //人力资源查询
        public async Task<IActionResult> Quer(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Quer(currentPage, pageSize)));
        }
        //人力资源查询回显
        public async Task<IActionResult> Query(int id)
        {
            return Content(JsonConvert.SerializeObject(await he.Query(id)));
        }
        //人力资源修改
        public async Task<int> Update(human_file _File)
        {
            return await he.Update(_File);
        }
    }
}
